<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>山洪预报预警系统</title>
    <script type="text/javascript" src="${cxt}/js/jquery/jquery.min.js?ver=1.7.1"></script>
    
<style type="text/css">
body { margin:0 auto;padding:0px; }	
a {text-decoration:none; display:block;}
.mainmenu {display:inline-block;}
.mainmenu_click {}
</style>

<script type="text/javascript">
//切换主菜单选项卡样式
$(function() {
	$(".mainmenu").click(function(){
		//样式切换
		$(".mainmenu_click").removeClass("mainmenu_click").addClass("mainmenu");
		$(this).removeClass("mainmenu").addClass("mainmenu_click");		
		var curpermid = $(this).attr("id");
		//AJAX数据请求
		$.ajax({
			type: "get",
			url: "${cxtpath}//security/login_userLogout.action",
			data: ({permid : curpermid}),
			dataType: "json",
			global: false,
			success: function(data, textStatus){
				$(".ajax.ajaxResult").html("");
				$("item",data).each(function(i, domEle){
					$(".ajax.ajaxResult").append("<li>"+$(domEle).children("title").text()+"</li>");
				});
			},
			error: function(){
				//请求出错处理
			}
		});
	});
});

//隐藏或显示菜单
$(function() {
	$( "#leftmenu" ).toggle();
});

function exitsystem()
{
	var url = "${cxtpath}/security/login_userLogout.action";
	$.get(url);
}
</script>
</head>
<body onUnload="exitsystem()">
  <div id="top" style="width:100%;height:100px;background:url(${cxt}/images/top.jpg);">
	<s:iterator id="perm" value="#request.mainmenu" >
	  <a id="<s:property value="#perm.permid"/>" class="mainmenu" href="${cxt}<s:property value="#perm.permuri"/>" target="mainiframe"><s:property value="#perm.permname"/></a>
	</s:iterator>
    <a href="${cxt}/system/security/login_userLogout.action"><img src="${cxt}/images/exitsystem.jpg" width="58" height="26" border="0"/></a> 
  </div>
 
  <div id="leftmenu" style="width:19%;height:100%;float:left;overflow-x:auto;">
  	左侧菜单
  </div>
 
  <div id="collap" style="width:1%;height:100%;float:left;cursor:pointer;">aa</div>
  <iframe id="mainiframe" name="mainiframe" src="${cxt}/system/system_indexPage.action" style="width:80%;height:100%;float:left;"></iframe>
</body>
</html>
